function formatPX(str: number | 1) {
  console.log(str)
  if (typeof str === 'string') {
    return `${parseInt(str)}px`
  } else if (typeof str === 'number') {
    return `${str}px`
  }
}

interface dance {
  jazz: () => void,
  urban: () => void
}

interface sing {
  pop: (name: string) => string,
  rock: () => void
}

function setActivity (activity: dance | sing): void {
  if ('pop' in activity) {
    activity.pop('爱我还是他')
  }
  if ('jazz' in activity) {
    activity.urban()
  }
}

type uni = {
  age: number
} | {
  age: never,
  [name: string]: string
}

let test: uni = {
  age: 1, // never和number进行类型缩减为number
  'ak': '123',
  'bk': 'sss'
}